package com.bruce.pattern.behavioral.strategy;

import org.junit.Test;

/**
 * Created by bruce on 2018/11/10 15:28
 */
public class MainTest {

    @Test
    public void test1() {

        PromotionActivity promotionActivity618 = new PromotionActivity(new LiJianPromotionStrategy());
        PromotionActivity promotionActivity1111 = new PromotionActivity(new FanXianPromotionStrategy());

        promotionActivity618.execute();
        promotionActivity1111.execute();

        PromotionStrategy strategy = PromotionStrategyFactory.getStrategy(PromotionStrategyFactory.PromotionType.FAN_XIAN);

        new PromotionActivity(strategy).execute();

    }


}
